import fetch from '@/utils/fetch'

export function apiScrap(scrapDto) {
  return fetch({
    url: '/api/v1/scrap',
    method: 'POST',
    data: scrapDto
  })
}
// 批量审批
export function apiBatchApproveScrap(scrapDto) {
  return fetch({
    url: '/api/v1/scrap/batch',
    method: 'POST',
    data: scrapDto
  })
}

export function apiGetScrapList (listQuery) {
  return fetch({
    url: '/api/v1/scrap/auditList',
    method: 'GET',
    params: listQuery
  })
}

export function apiDownload (listQuery) {
  return fetch({
    url: '/api/v1/scrap/download',
    method: 'post',
    data: listQuery,
    responseType: 'arraybuffer'
  })
}
// 报废已审批
export function apiGetAlreadyScrapList (listQuery) {
  return fetch({
    url: '/api/v1/scrap/already/auditList',
    method: 'GET',
    params: listQuery
  })
}
// 报废页面数据导出
export function apiScrapListExport (listQuery) {
  return fetch({
    url: '/api/v1/scrap/export',
    method: 'POST',
    data: listQuery,
    responseType: 'arraybuffer'
  })
}
